package top.kaoshanji.p4ch25b;

/**
 * 代码清单-p4ch25b-314页a：抽象员工类
 * @author kaoshanji
 * ^_^
 * create time 2025/3/27 10:24
 */
public abstract class Employee {

    public final static int MALE = 0;  // 0 代表男性
    public final static int FEMALE = 1; // 1 代表女性

    // 姓名
    private String name;
    // 薪水
    private int salary;
    // 性别
    private int sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    /**
     * 我允许一个访问者访问
     * @param visitor IVisitor
     */
    public abstract void accept(IVisitor visitor);

}
